package com.cll.learn.stage10.example2;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2021/5/13 20:50
 */
public class Test {

    public static void main(String[] args) {
        // 背包容量
        int person = 10;
        List<GoldResource> goldResourceList = new ArrayList<>(5);
        // 金矿耗费人力为2，容量为600
        GoldResource goldResource1 = new GoldResource(2, 600);
        GoldResource goldResource2 = new GoldResource(2, 300);
        GoldResource goldResource3 = new GoldResource(6, 500);
        GoldResource goldResource4 = new GoldResource(5, 400);
        GoldResource goldResource5 = new GoldResource(4, 600);

        goldResourceList.add(goldResource1);
        goldResourceList.add(goldResource2);
        goldResourceList.add(goldResource3);
        goldResourceList.add(goldResource4);
        goldResourceList.add(goldResource5);

//        GoldResource goldResource1 = new GoldResource(2, 3);
//        GoldResource goldResource2 = new GoldResource(3, 4);
//        GoldResource goldResource3 = new GoldResource(4, 5);
//        GoldResource goldResource4 = new GoldResource(5, 6);
//
//        goldResourceList.add(goldResource1);
//        goldResourceList.add(goldResource2);
//        goldResourceList.add(goldResource3);
//        goldResourceList.add(goldResource4);

        King king = new King(person, goldResourceList);

        Result result = king.selectGoldResourceResult();
        System.out.println("最终产生的最优解 = " + result.toString());
    }
}
